<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>Untitled Document</title>
	</head>
	<body>

<?
if($_POST["html"]){
	echo "<XMP>";
	echo $_POST["html"];
	echo "</XMP>";

	$htmlContent = $_POST["html"];
	$htmlContent = str_replace("\\\"", "\"", $htmlContent);
	
	echo "<XMP>";
	echo $htmlContent;
	echo "</XMP>";
	
	$realtiveDirectory = "results/";
	$htmlFileName = "test.html";
	$htmlFileHandle = fopen($realtiveDirectory . $htmlFileName, 'w') or die("can't open file");
	fwrite($htmlFileHandle, $htmlContent);
	fclose($htmlFileHandle);
	
	$currentPath = exec('pwd');
	$htmlFilePath = $currentPath . "/" . $realtiveDirectory . $htmlFileName;
	echo $htmlFilePath;
	
	$firefoxPath = "/Applications/Firefox.app/Contents/MacOS/firefox-bin";
	$execFirefox = exec(firefoxPath'pwd');
	
	//"/Applications/Firefox.app/Contents/MacOS/firefox-bin"
	
	//firefox -no-remote -P "PearlCrescent"
	
	//   /Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -P "PearlCrescent" -saveimage "/Applications/xampp/xamppfiles/htdocs/dasviewer/src/main/webapp/results/test.html"
    // /Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -P "default" -saveimage "/Applications/xampp/xamppfiles/htdocs/dasviewer/src/main/webapp/results/test.html"


}

?>	
	</body>
</html>

